package com.easy.customer.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easy.common.bean.CustomerInteractions;
import com.easy.common.service.ICustomerInteractionsService;
import com.easy.common.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@CrossOrigin
@RestController
@RequestMapping("interaction")
public class CustomerInteractionsController {
    @Autowired
    ICustomerInteractionsService interactionService;
    @PostMapping("/")
    public ResultData insert(@RequestBody CustomerInteractions interaction){
        CustomerInteractions result=interactionService.insert(interaction);
        return ResultData.success(result);
    }
    @PutMapping("/")
    public ResultData update(@RequestBody CustomerInteractions interaction){
        return ResultData.success(interactionService.update(interaction));
    }

    @GetMapping("/page")
    public ResultData getListByPage(IPage page,@RequestBody CustomerInteractions interaction){
        IPage<CustomerInteractions> data=interactionService.getListByPage(page,interaction);
        return ResultData.success(data);
    }

}
